package GUILayer;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JPasswordField;


public class Forside {

	private JFrame frame;
	private JTextField textField;
	private JPasswordField passwordField;
	private Varer varer;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Forside window = new Forside();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public Forside() {
		varer = new Varer();
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 674, 412);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(null);
		
		JLabel lblVestbjergByggecenterAs = new JLabel("Vestbjerg Byggecenter A/S");
		lblVestbjergByggecenterAs.setFont(new Font("Tahoma", Font.PLAIN, 25));
		lblVestbjergByggecenterAs.setBounds(160, 29, 338, 68);
		frame.getContentPane().add(lblVestbjergByggecenterAs);
		
		textField = new JTextField();
		textField.setBounds(239, 137, 134, 25);
		frame.getContentPane().add(textField);
		textField.setColumns(10);
		
		JLabel lblPersonaleIdlogin = new JLabel("Personale id(Login)");
		lblPersonaleIdlogin.setBounds(239, 122, 134, 14);
		frame.getContentPane().add(lblPersonaleIdlogin);
		
		JLabel lblPersonalePassword = new JLabel("Personale Password (Kode)");
		lblPersonalePassword.setBounds(239, 180, 134, 14);
		frame.getContentPane().add(lblPersonalePassword);
		
		JButton btnNewButton = new JButton("Login");
		btnNewButton.setBounds(263, 230, 89, 23);
		frame.getContentPane().add(btnNewButton);
		btnNewButton.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent e)
			{
				login();
			}
		});
		
		passwordField = new JPasswordField();
		passwordField.setBounds(239, 194, 134, 25);
		frame.getContentPane().add(passwordField);
	}
	
	public void login()
	{
		varer.main(null);
		varer.setVisible(true);
	}
}
